package FactoryMode;

public class Factory {

    private int a;
    private int b;

    public void setA(int a) {
        this.a = a;
    }

    public void setB(int b) {
        this.b = b;
    }

    public static Factory abFun(int a, int b){
        Factory factory = new Factory();
        factory.setA(a);
        factory.setB(b);
        return factory;
    }

    public static Factory baFun(int a,int b){
        Factory factory = new Factory();
        factory.setA(b);
        factory.setB(a);
        return factory;
    }

    public void print(){
        System.out.println(a - b);
    }

}
